import hashlib
def md5(pwd):
    password=hashlib.md5(pwd.encode())
    return password.hexdigest()

from utlis.mysql import db
def prepare(roleid):
    sql=f"""select res.url from role_resource as rr left join resource as res on rr.resourceid=res.id where rr.userid={roleid} and res.type=2;"""
    res=db.findAll(sql)
    lst=[]
    for i in res:
        lst.append(i["url"])
    return lst

